/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bash.jcouture.util.swing;

import com.bash.compta.data.Depense;
import com.bash.compta.data.Taux;
import com.bash.compta.db4o.MagicData;
import java.text.SimpleDateFormat;

import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author bashizip
 */
public class TauxTableModel extends AbstractTableModel {

    private List<Taux> data=MagicData.getAllObjects(Taux.class);
    private String[] colones = {"DATE", "DEVISE", "VALEUR"};

 

    public TauxTableModel(List<Taux> data) {
        this.data = data;
    }

    public TauxTableModel() {
        
    }

    public int getRowCount() {
        return data.size();
    }

    public int getColumnCount() {
        return colones.length;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Taux c = data.get(rowIndex);

        Object toReturn = null;

        switch (columnIndex) {
            case 0:
                toReturn = c.getDate();
                break;
            case 1:
                toReturn = c.getDevise();
                break;
            case 2:

                toReturn = c.getValeur();
                break;
           

        }
        return toReturn;

    }

    @Override
    public String getColumnName(int column) {
        return colones[column];
    }

    @Override
    public boolean isCellEditable(int rowIndex, int columnIndex) {
        return false;
    }
}
